<template>
    <div>
        <van-nav-bar title="标题" left-text="返回" left-arrow @click-left="()=>(router.push('/index/fl'))" />

        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />

        <van-cell-group v-for="item in qsearch">
            <van-cell :title="item.goods_name"/>
        </van-cell-group>
    </div>
</template>

<script setup>
import { ref, watch } from 'vue';
import { qsearchApi } from '@/api/api';
import router from '@/router';
let value=ref('')
let qsearch=ref([])
watch(value,(ss)=>{
    console.log('监听数据',ss)
    qsearchApi(ss).then(res=>{
      console.log('搜索数据',res)
      qsearch.value=res.data.message
    })
})
</script>

<style lang="scss" scoped></style>